#ifndef _GFILE
#define _GFILE
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "elemGenerique.h"
#include "liste.h"

extern volatile sig_atomic_t STOP;

struct s_gFile{
  pthread_mutex_t mut;
  pthread_cond_t non_vide;
  pthread_cond_t non_plein;
  List file;
  int maxSock;
  int nbSock;
  int sockPair[2];
};

typedef struct s_gFile gFile;

void InitialiseGFile(gFile * gFil, const int maxSock);

void TestamentGFile(gFile * gFil);

int InsererFile(int sock, gFile * gFile);

int DepilerFile(gFile * gFile);

#endif
